<?php

/**
 * StormTrackPrediction form base class.
 *
 * @method StormTrackPrediction getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseStormTrackPredictionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ISTORM_ID'          => new sfWidgetFormInputHidden(),
      'DTTIME'             => new sfWidgetFormInputHidden(),
      'DTPREDICT_TIME'     => new sfWidgetFormInputHidden(),
      'ISPEED'             => new sfWidgetFormInputText(),
      'ILEVEL'             => new sfWidgetFormInputText(),
      'ILATITUDE_DEGREE'   => new sfWidgetFormInputText(),
      'ILATITUDE_MINUTE'   => new sfWidgetFormInputText(),
      'ILATITUDE_SECOND'   => new sfWidgetFormInputText(),
      'ILONGITUDE_DEGREE'  => new sfWidgetFormInputText(),
      'ILONGITUDE_MINUTE'  => new sfWidgetFormInputText(),
      'ILONGITUDE_SECOND'  => new sfWidgetFormInputText(),
      'IVARIANCE_UPWARD'   => new sfWidgetFormInputText(),
      'IVARIANCE_DOWNWARD' => new sfWidgetFormInputText(),
      'IVARIANCE_FORWARD'  => new sfWidgetFormInputText(),
      'SDOC_LINK'          => new sfWidgetFormInputText(),
      'IUSER_ID'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ISTORM_ID'          => new sfValidatorChoice(array('choices' => array($this->getObject()->getIstormId()), 'empty_value' => $this->getObject()->getIstormId(), 'required' => false)),
      'DTTIME'             => new sfValidatorChoice(array('choices' => array($this->getObject()->getDttime()), 'empty_value' => $this->getObject()->getDttime(), 'required' => false)),
      'DTPREDICT_TIME'     => new sfValidatorChoice(array('choices' => array($this->getObject()->getDtpredictTime()), 'empty_value' => $this->getObject()->getDtpredictTime(), 'required' => false)),
      'ISPEED'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILEVEL'             => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILATITUDE_DEGREE'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILATITUDE_MINUTE'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILATITUDE_SECOND'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILONGITUDE_DEGREE'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILONGITUDE_MINUTE'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'ILONGITUDE_SECOND'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IVARIANCE_UPWARD'   => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IVARIANCE_DOWNWARD' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'IVARIANCE_FORWARD'  => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'SDOC_LINK'          => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'IUSER_ID'           => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('storm_track_prediction[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'StormTrackPrediction';
  }


}
